/*
 * @(#)SizeParameter.java   1.0   May 11, 2007
 *
 * Copyright 2000-2007 ETH Zurich. All Rights Reserved.
 *
 * This software is the proprietary information of ETH Zurich.
 * Use is subject to license terms.
 *
 * @(#) $Id: SizeParameter.java 412 2007-05-11 15:46:21Z D\aldespin $
 */
package ch.ethz.globis.javaom.collection.imp;

import ch.ethz.globis.javaom.collection.ReduceParameter;

/**
 * @author aldespin
 * @version 1.0
 */
public class SizeParameter implements ReduceParameter {

   /**
    * {@inheritDoc}
    */
   public Object isEmpty() {
      return new Integer(0);
   }

   /**
    * {@inheritDoc}
    */
   public Object isSingle(final Object member) {
      return new Integer(1);
   }

   /**
    * {@inheritDoc}
    */
   public Object combine(Object lhs, Object rhs) {
      return new Integer((((Integer) lhs).intValue() + ((Integer) rhs).intValue()));
   }
}
